package com.example.beautymakeup.dao;

import com.example.beautymakeup.pojo.Classify;
import com.example.beautymakeup.pojo.Hot;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClassifyDao {
    @Select("select * from classify where status = 0;")
    List<Classify> get();

    @Select("select * from classify limit #{page},#{size};")
    List<Classify> getAll(@Param("page") int page, @Param("size") int size);

    @Select("select * from classify;")
    List<Classify> getTypeAll();

    @Update("update classify set title = #{title} where uid = #{uid};")
    int update(Classify classify);

    @Insert("insert into classify(title) values (#{title});")
    int add(Classify classify);

    @Select("select count(*) from classify where status = 0;")
    int getCount();

    @Select("select count(*) from classify;")
    int getAllCount();

    @Update("update classify set status = #{status} where uid = #{uid};")
    int ban(Classify classify);

    @Delete("delete from classify where uid = #{uid};")
    int delete(Classify classify);
}
